package cn.tank.service.impl;

import cn.tank.service.IHelloService;
import org.apache.dubbo.config.annotation.Service;

import java.util.Random;
import java.util.concurrent.TimeUnit;

@Service
public class HelloServiceImpl implements IHelloService {

    private static Random random = new Random();

    @Override
    public String methodA(String name) {
        try {
            TimeUnit.MILLISECONDS.sleep((long)random.nextInt(100));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "hello to "+name;
    }

    @Override
    public String methodB(String name) {
        try {
            TimeUnit.MILLISECONDS.sleep((long)random.nextInt(100));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "hello to "+name;
    }

    @Override
    public String methodC(String name) {
        try {
            TimeUnit.MILLISECONDS.sleep((long)random.nextInt(100));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "hello to "+name;
    }
}
